package com.league.zjxn.jetpack.repository

import com.league.zjxn.app.SPSConstance
import com.league.zjxn.base.BaseManager
import com.league.zjxn.entity.HomeDataResponse
import com.league.zjxn.entity.MessageResponse
import com.module.lemlin.http.HttpResponseData
import rxhttp.RxHttp
import rxhttp.await

open class MessageRepository : BaseManager() {

    suspend fun messageList(page: String, limit: String): MessageResponse =
        RxHttp.get("/api/user/allianceMessage")
            .addHeader("token", SPSConstance.token ?: "")
            .add("page", page)
            .add("limit", limit)
            .await()

    suspend fun messageRead(type: String, id: String): HttpResponseData =
        RxHttp.get("/api/user/read")
            .addHeader("token", SPSConstance.token ?: "")
            .add("type", type)
            .add("id", id)
            .await()
}